<template>
  <van-share-sheet
      v-model:show="showShare"
      title="立即分享给好友"
      :options="shareOptions"
      @select="onShareSelect"
  />
</template>

<script>
import {useDark, useToggle} from "@vueuse/core";

export default {
  name: "common",
  data(){
    return{
      showShare:false,
      shareOptions : [
        { name: '微信', icon: 'wechat' },
        { name: '微博', icon: 'weibo' },
        { name: '复制链接', icon: 'link' },
        { name: '分享海报', icon: 'poster' },
        { name: '二维码', icon: 'qrcode' },
      ]
    }
  },
  methods: {
    onShareSelect(){
      const isDark = useDark()
      const toggleDark = useToggle(isDark)
      toggleDark()
      // this.showShare = false;
    },
    headerBack() {
      history.back()
    },
    headerShare() {
      // this.showShare = true;
      const isDark = useDark()
      const toggleDark = useToggle(isDark)
      toggleDark()
    },
    viewBookInfo(e) {
      this.$router.push({
        path: '/book-detail',
        params: e || ''
      })
    },
    routerLink(e){
      this.$router.push({
        path: e,
      })
    },
  }
}
</script>

<style scoped>

</style>
